﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CarseScript;

namespace CarseTestA
{
    /// <summary>
    /// 
    /// </summary>
    /// <remarks>
    /// This program demonstrates creation of a simple script and running it.
    /// </remarks>
    class Program
    {
        static void Main(string[] args)
        {
            // create scripter:
            Scripter scripter = new Scripter();

            // scripter needs to get access to the namespace CarseTestA 
            scripter.AddAssembly(typeof(SystemScript).Assembly.Location);

            // get the path to the scripts
            string scriptFilePath = System.IO.Path.GetDirectoryName(
                System.Reflection.Assembly.GetExecutingAssembly().Location);
            scriptFilePath += "\\Scripts";

            // load the scripts
            scripter.LoadScripts(false, scriptFilePath);
            
            // run the script
            scripter.InvokeScript("s_write", null);

            // exit
            Console.WriteLine("Press any key to exit");
            Console.ReadKey();
        }
    }
}
